<?php
require 'vendor/autoload.php';

$app = new think\App();
$app->initialize();

echo "=== 检查应用配置 ===\n\n";

// 检查配置
$config = $app->config->get('app');
echo "RBAC忽略应用: " . json_encode($config['rbac_ignore'] ?? []) . "\n";
echo "应用映射: " . json_encode($config['app_map'] ?? []) . "\n";
echo "超级用户: " . ($config['super_user'] ?? 'admin') . "\n\n";

// 检查当前登录用户
echo "=== 检查Session ===\n\n";
$session = $app->session;
echo "Session ID: " . $session->getId() . "\n";
echo "Session数据: " . json_encode($session->all()) . "\n\n";

// 检查菜单服务
echo "=== 检查菜单服务 ===\n\n";
try {
    $menus = \think\admin\service\MenuService::getTree();
    echo "菜单树数量: " . count($menus) . "\n";
    echo "菜单内容:\n";
    print_r($menus);
} catch (\Exception $e) {
    echo "错误: " . $e->getMessage() . "\n";
}

